package utilities;

import publicComponent.PublicComponent;
import hibernate.administratorAccount.Licence;

import java.util.List;
import java.util.ArrayList;
import java.util.Map;

import org.zkoss.zk.ui.HtmlMacroComponent;
import org.zkoss.zul.Messagebox;

public class RoomingIncomeController extends HtmlMacroComponent implements PublicComponent{
	private static boolean isOpen = false;
	
	/*  Implement inherited method  */
	public boolean onBeforeCreate(){
		if( isOpen )
			return false;
		else
			return true;
	}
	
	public void onAfterCreate(){
		isOpen = true;
	}
	
	public boolean onBeforeClose(){
		return true;
	}
	
	public void onAfterClose(){
		isOpen = false;
	}
	
	public boolean isInline(){
		return false;
	}
	
	public String getTitle(){
		return "房费收入明细表";
	}
	
	/*  To be implemented  */
	public List getMenuList(){
		return null;
	}
	/*  To be implemented  */
	public List getCommandList(){
		return null;
	}
	/*  To be implemented  */
	public boolean processCommand( String commandName ){
		return true;
	}
	/*  To be implemented  */
	public void setMenuPara( Map m ){
		
	}
	
	public boolean licenseAccepted(Licence licence) {
		// TODO Auto-generated method stub
		if( ( licence != null ) && licence.getAppLicenceMapping().contains( this.getTitle() ) )
			return true;
		else{
			try{
				new Messagebox().show( "您无权访问该页面!" );
			}catch( InterruptedException exception ){
				/*  Ignore  */
			}
			return false;
		}
	}
}